#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>

struct PrintFunctor
{
    void operator()(const int &i)
    {
        std::cout << i << "\t";
    }
};

int main(int argc, char const *argv[])
{
    std::vector<int> vector{};
    vector.assign(10, 100);

    std::for_each(vector.begin(), vector.end(), PrintFunctor());
    std::cout << std::endl;

    int sum = std::accumulate(vector.begin(), vector.end(), 000);
    std::cout << sum << std::endl;

    std::fill(vector.begin(), vector.begin() + 5, 99);
    std::for_each(vector.begin(), vector.end(), PrintFunctor());
    std::cout << std::endl;

    return 0;
}
